/**
 * 小程序配置文件
 */
var host = 'xxx.xxx.xxx';
var dev_host="xxx.xxx.xxx";

var isDev=false;
var config={
    api:{
        wx_login:'/api/login',
        wx_user_info:'/api/user/info',
        wx_phone:'/api/phone/info',
        wx_user_decodephone:'/api/user/phone'
    },
    service:{},
    getApi:function(key){
        return this.service.apiUrl+this.api[key];
    }
};

if(isDev){
    config.service={
        dev_host,
        apiUrl: `http://${dev_host}`,
    }

}else{
    // 线上环境配置
    config.service={
        host,
        apiUrl: `https://${host}`
    }

}

module.exports = config;
